package com.litesuits.sdk.listener;

import android.support.v4.app.Fragment;

public abstract class FragProgressHttpListener<T> extends AbsProgressHttpListener<T> {
    protected Fragment fragment;

    public FragProgressHttpListener(Fragment fragment) {
        super(fragment.getActivity());
        this.fragment = fragment;
    }

    public FragProgressHttpListener(Fragment fragment, boolean isProgressCancelable) {
        super(fragment.getActivity(), isProgressCancelable);
        this.fragment = fragment;
    }

    @Override
    public boolean disableListener() {
        return  fragment == null || !fragment.isAdded() || super.disableListener();
    }
}